package cate.common.table.d;

import cate.common.table.common.ParamSheet;
import cate.common.util.TimeTool;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

@SuppressWarnings("unused")
@NoteClass(value = "协会相关")
public class GDGuild {

    @NoteField(value = "协会排行显示个数")
    public static final int RANK_LIMIT = 20;
    @NoteField(value = "协会排行显示开始点")
    public static final int START_VALUE = 0;
    @NoteField(value = "协会排行h会长显示个数")
    public static final int RANK_PRESIDENT_LIMIT = 3;
    @NoteField(value = "协会申请列表容量")
    public static final int APPLY_NUM_LIMIT = 99;
    public static final double BUFF_AR = 200;

    @NoteField(value = "协会每日每人贡献协会建设值上限")
    public static int PER_MEMBER_GUILD_EXP;

    @NoteField(value = "每日免费刷新次数")
    public static int FREE_TIME;

    @NoteField(value = "刷新的价格")
    public static String ITEM_CFG;

    @NoteField(value = "每次刷新出的任务数量")
    public static int TASK_REFRESH_NUM_LIMIT;

    @NoteField(value = "解除协会自动解散需要完成日常任务的成员数量")
    public static long UNDO_DISBAND_REQUIRE_MEMBER;

    @NoteField(value = "解除协会自动解散需要成员完成日常任务数量")
    public static final long UNDO_DISBAND_TASK_FINISH = 1;

    @NoteField(value = "元宝金币汇率")
    public static final int TRANSFER_M1_TO_M0 = 1000;

    @NoteClass(value = "协会-基础 ")
    public static final class basic {
        @NoteField(value = "协会编号长度")
        public static final int GUILD_NO_PATTERN_SIZE = 6;
        @NoteField(value = "协会编号服务器编号格式")
        public static final int GUILD_NO_SRV_PATTERN_SIZE = 3;

        @NoteField(value = "协会开服第【】天在协会数量为0时创建机器人协会")
        public static final int FAKE_GUILD_DAY = 1;

        @NoteField(value = "协会开服自动创建基数")
        public static int FAKE_GUILD_NUM = 5;

        @NoteField(value = "协会开服自动创建随机数")
        public static int FAKE_GUILD_NUM_RANDOM = 5;

        @NoteField(value = "开服自动创建协会会长等级设置")
        public static int FAKE_GUILD_PRESIDENT_LEVEL = 30;


        @NoteField(value = "创建协会需要的VIP等级")
        public static int VIP_LEVEL_REQUIRED;
        @NoteField(value = "默认创建公会的人数即本人")
        public static final int DEFAULT_GUILD_CREATE_NUM = 0;
        @NoteField(value = "创建协会后默认需要验证与否")
        public static final boolean DEFAULT_GUILD_AUTHENTICATION = false;
        @NoteField(value = "创建协会默认申请等级需要")
        public static final int DEFAULT_GUILD_LEVEL_REQUIRED = 1;
        @NoteField(value = "创建协会后默认宣言")
        public static String DEFAULT_GUILD_DECLARATION;
        @NoteField(value = "创建协会花费")
        public static String CREATE_COST;
        @NoteField(value = "名称最小长度")
        public static int NAME_LENGTH_MIN;
        @NoteField(value = "名称最大长度")
        public static int NAME_LENGTH_MAX;
        @NoteField(value = "协会宣言最长")
        public static int DECLARATION_LENGTH_MAX;
        @NoteField(value = "退出公会惩罚时间")
        public static long PUNISH_SECOND;
        @NoteField(value = "开服第一天惩罚时间")
        public static long FIRST_DAY_PUNISH_SECOND;
        @NoteField(value = "退出公会惩罚时间")
        public static int GUILD_OPEN_DAY;
        //改名花费
        public static String CHANGE_NAME_COST;
        public static final byte CHANGE_NAME_COST_TYPE = GDObj.Num.M1;
        public static final long APPLY_KEEP_HOUR = 12;
        //同一时间申请协会最大数量
        public static int APPLY_GUILD_NUM_MAX;
        public static final int RECORD_NUM_MAX = 3;
        public static int KICK_OUT_NUM_MAX;
    }

    @NoteClass(value = "协会-协会职位 ")
    public static final class position {
        @NoteField(value = "成员")
        public static final byte MEMBER = 0;
        @NoteField(value = "长老")
        public static final byte PRESBYTER = 1;
        @NoteField(value = "副会长")
        public static final byte VICE_PRESIDENT = 2;
        @NoteField(value = "会长")
        public static final byte PRESIDENT = 3;


        public static final byte[] all = new byte[]{MEMBER, PRESBYTER, VICE_PRESIDENT,
                PRESIDENT};

        /**
         * 检查职位是否存在
         */
        public static boolean check(byte pos) {
            for (byte p : all) {
                if (p == pos) {
                    return true;
                }
            }
            return false;
        }

        public static String des(byte pos) {
            switch (pos) {
                case VICE_PRESIDENT:
                    return "副掌门";
                case PRESIDENT:
                    return "掌门";
                case PRESBYTER:
                    return "长老";
                case MEMBER:
                default:
                    return "成员";
            }
        }
    }

    @NoteClass(value = "协会-协会招募 ")
    public static final class recruit {
        @NoteField(value = "")
        public static long RECRUIT_INTERVAL_SECEND_MIN;

        public static int DAILY_RECRUIT_NUM_MAX;
        public static int DAILY_FREE_RECRUIT_TIME;
        public static final byte RECRUIT_COST_TYPE = GDObj.Num.M1;
        public static String RECRUIT_COST;
    }

    @NoteClass(value = "协会-协会日志文本ID")
    public static final class log {
//        new GuildLogDetailPO(GDGuild.log.DONATE_GUILD, role.getBase().name)

        @NoteField(value = "挑战协会boss")
        public static final int CHALLENGE_BOSS = 42001;

        @NoteField(value = "扫荡协会boss")
        public static final int MOP_BOSS = 42002;

        @NoteField(value = "增加攻击boss的buff")
        public static final int ADD_GUILD_BUFF = 42003;


        //build
        @NoteField(value = "建设-捐献")
        public static final int DONATE_GUILD = 100001;
//                700001;

        //member
        @NoteField(value = "任命副会长")
        public static final int APPOINT_VICE_PRESIDENT = 200001;
//        700002

        @NoteField(value = "任命新长老")
        public static final int APPOINT_PRESBYTER = 200002;
//        700003

        @NoteField(value = "任命新会长")
        public static final int APPOINT_PRESIDENT = 200003;
//        700004

        @NoteField(value = "罢免长老")
        public static final int DISMISS_PRESBYTER = 200004;
//        700005

        @NoteField(value = "解雇副会长")
        public static final int DISMISS_VICE_PRESIDENT = 200005;
//        700006

        @NoteField(value = "新成员加入")
        public static final int NEW_MEMBER_JOIN = 200006;
//        700007

        @NoteField(value = "退会")
        public static final int QUIT_GUILD = 200007;
//        700008

        @NoteField(value = "踢人")
        public static final int KICK_OUT_MEMBER = 200008;
//        700009

        //协会成员行为记录
        @NoteField(value = "发红包")
        public static final int DISTRIBUTE_RED_ENVELOPE = 200009;
//                700010;

        @NoteField(value = "食灵召唤-5星")
        public static final int HERO_CALL_5_STAR = 200010;
        @NoteField(value = "定制手办", detail = "name,【神话】item.name")
        public static final int FURNITURE_TOP_ITEM = 200011;
        @NoteField(value = "占星奖励", detail = "name, item")
        public static final int ASTROLOGY_SPECIAL_ITEM = 200012;
        @NoteField(value = "积分赛连胜")
        public static final int POINT_RACE_CONTINUE_WIN = 200013;
        @NoteField(value = "缚灵之塔挑战", detail = "name, 层")
        public static final int MAIN_TOWER_PASSED_NUM = 200014;
        @NoteField(value = "水晶峡谷通关", detail = "name, rankId")
        public static final int SPICEFB_CHAPTER_UNLOCKED = 200017;

        //系统赠送
        public static final int SYSTEM_SEND_GIFT = 310195;
        //公会宝库放入
        public static final int PUT_TREASURE_IN = 310197;
        // 公会宝库取出
        public static final int TAKE_TREASURE_OUT = 310198;
        //宝物过期
        public static final int TREASURE_EXPIRED = 310199;
        // 公会秘境BOSS奖励
        public static final int FAIRYLAND_GIFT = 310200;
        // 公会战奖励
        public static final int GUILD_WAR_GIFT = 310196;
    }

    @NoteClass(value = "协会-协会成员管理")
    public static final class member {
        @NoteField(value = "协会-协会会长默认未上线天数大于等于三天")
        public static final boolean PRESIDENT_NO_EXPIRED_LIMIT = false;
        public static final boolean PRESIDENT_EXPIRED_LIMIT = true;
        public static final long DEFAULT_TIMER_VALUE = 0;
        public static int EXPIRED_DAY;
        public static final int AUTO_TRANSFER_DAY = 1;
        public static int LOG_NUM_MAX;
    }

    @NoteClass(value = "协会-协会建设")
    public static final class build {
        @NoteField(value = "协会-协会未上缴维护资金就解散的天数")
        public static int BUILD_DISBAND_UNFIX_DAY;
        @NoteField(value = "协会-协会未上缴维护资金天数")
        public static final int BUILD_DEFAULT_DAY = 0;
    }

    @NoteClass(value = "公会-公会活跃任务刷新周期类型 ")
    public static final class refreshType {
        @NoteField(value = "每日刷新")
        public static final byte t0 = 0;

        @NoteField(value = "每周刷新")
        public static final byte t1 = 1;
    }

    @NoteClass(value = "协会-协会捐献 ")
    public static final class donate {
        @NoteField(value = "累计值与下一次累计值的差值")
        public static final int DIFF_NEXT_TIME = 1;
        @NoteField(value = "每周刷新")
        public static int DONATE_TIMES_LIMIT;
        public static int DONATE_FREE_TIMES;
    }

    @NoteClass(value = "协会-协会内政任务 ")
    public static final class task {
        @NoteField(value = "自动刷新模式")
        public static final int AUTO_REFRESH_TYPE = 0;
        @NoteField(value = "手动刷新模式")
        public static final int UN_AUTO_REFRESH_TYPE = 1;
        @NoteField(value = "每天发放的任务数量")
        public static final int DAILY_TASK_NUM = 5;
        @NoteField(value = "每天自动免费刷新任务的时间")
        public static String REFRESH_TIME;
    }

    public static final class redEnvelope {
        @NoteField(value = "红包失效时间")
        public static long RED_ENVELOPE_KEEP_HOUR;
        @NoteField(value = "红包随机数的离散程度")
        public static double DISPERSION_COEFFICIENT;
        @NoteField(value = "红包保底系数")
        public static double GUARANTEE_COEFFICIENT;
        @NoteField(value = "玩家每日抢红包的最大次数")
        public static int MAX_DRAW_TIME;
        @NoteField(value = "玩家发放红包的消息")
        public static final String ENVELOPE_MSG_CONTENT = "";
    }

    public static final class boss {

        @NoteField(value = "购买挑战次数上限")
        public static String BUY_CHALLENGE_TIME_COST;
        @NoteField(value = "buff层数上限")
        public static int BUFF_NUM_MAX;
        @NoteField(value = "BUFF购买消耗m1")
        public static String BUFF_COST;

        public static long HORN_INTERVAL;
        public static String HORN_MSG_CONTENT;
        @NoteField(value = "每层BUFF增加攻击力万分比")
        public static long BUFF_ADD_Fight;


        @NoteField(value = "BUFF购买消耗m1")
        public static final int RANK_NONE_INDEX = -1;
        public static double RANK_REWARD_1;
        public static double RANK_REWARD_2;
        public static double RANK_REWARD_3;
        public static double RANK_REWARD_4_10;
        public static double RANK_REWARD_11_20;
        public static double RANK_REWARD_21_50;
    }

    @NoteClass(value = "公会-公会活跃任务ID ")
    public static final class activeTask {
        @NoteField(value = "升级公会技能")
        public static int LIGHT_GUILD_SKILL = 1;
        @NoteField(value = "公会捐献通用")
        public static int DONATE_COMMON = 2;

        @NoteField(value = "挑战公会boss")
        public static int FIGHT_BOSS = 3;

        @NoteField(value = "公会商店消费")
        public static int GUILD_SHOP = 0;

        @NoteField(value = "增加攻击公会boss的buff")
        public static int ADD_GUILD_BUFF = 8;

        @NoteField(value = "零值--非法除数")
        public static final int ZERO = 0;
    }

    //  协会技能
    public static class Skill {

        public static final byte NORMAL_SKILL_TYPE = 0;
        public static final byte PVP_SKILL_TYPE = 1;
        public static int PVP_OPEN_NORMAL_LEVEL;
        public static String FIRST_COST_FOR_NORMAL_SKILL_BACK;
        public static String FIRST_COST_FOR_PVP_SKILL_BACK;
        public static final int NORMAL_SKILL_ORIGIN_LEVEL = 0;
        public static final int PVP_SKILL_ORIGIN_LEVEL = 0;
        public static final int PVP_UPGRADE_CONDITION_ON_OTHER_NUM = 3;
        public static String COST_FOR_NORMAL_SKILL_BACK;
        public static String COST_FOR_PVP_SKILL_BACK;

    }

    //公会错误消息ID
    public static class ErrorMsgId {
        public static final int GUILD_LEVEL = 310402;
        public static final int GUILD_ENTER_DAY = 310149;


    }

    public static class TreasureHouse {
        @NoteField(value = "公会成员每人每天能放入的次数")
        public static int TREASURE_HOUSE_PUT_IN_TIMES_DAY;
        @NoteField(value = "日志（交易记录）过期天数")
        public static final int LOG_EXPIRED_DAY = 7;
        @NoteField("加入公会x天后可以使用宝库")
        public static int JOIN_DAY_LIMIT = 3;
    }

    public static class Fairyland {
        @NoteField("击杀奖励邮件ID")
        public static int KILL_MAIL_ID;
        @NoteField("排行奖励邮件ID")
        public static int RANK_MAIL_ID;
        @NoteField("新加入成员的挑战CD")
        public static long NEW_MEMBER_COLD = 24 * TimeTool.TimeCons.HOUR;
        @NoteField("秘境单次开启挑战时间")
        public static long CHALLENGE_TIME = 24 * TimeTool.TimeCons.HOUR;
        @NoteField("秘境单次开启冷却时间")
        public static long COLD_TIME = 48 * TimeTool.TimeCons.HOUR;
    }


    /**
     * 读取excel中配置的参数
     */
    public static void initialize(ParamSheet paramSheet) {
        FREE_TIME = GDParamTool.getInt(paramSheet, 10001, 1);
        ITEM_CFG = GDParamTool.getString(paramSheet, 10002, "0:1:20");
        TASK_REFRESH_NUM_LIMIT = GDParamTool.getInt(paramSheet, 10003, 999);
        UNDO_DISBAND_REQUIRE_MEMBER = GDParamTool.getLong(paramSheet, 10026, 5L);
        basic.VIP_LEVEL_REQUIRED = GDParamTool.getInt(paramSheet, 10006, 3);
        basic.DEFAULT_GUILD_DECLARATION = GDParamTool.getString(paramSheet, 10013, "欢迎加入协会一起发展！");
        basic.CREATE_COST = GDParamTool.getString(paramSheet, 10008, "");
        basic.NAME_LENGTH_MIN = GDParamTool.getInt(paramSheet, 10010, 2);
        basic.NAME_LENGTH_MAX = GDParamTool.getInt(paramSheet, 10011, 12);
        basic.DECLARATION_LENGTH_MAX = GDParamTool.getInt(paramSheet, 10012, 30);
        basic.PUNISH_SECOND = GDParamTool.getInt(paramSheet, 10015, 43200);
        basic.FIRST_DAY_PUNISH_SECOND = GDParamTool.getInt(paramSheet, 10014, 3600);
        basic.GUILD_OPEN_DAY = GDParamTool.getInt(paramSheet, 10017, 1);
        basic.CHANGE_NAME_COST = GDParamTool.getString(paramSheet, 10009, "");
        basic.APPLY_GUILD_NUM_MAX = GDParamTool.getInt(paramSheet, 10016, 100);
        basic.KICK_OUT_NUM_MAX = GDParamTool.getInt(paramSheet, 10004, 5);
        basic.FAKE_GUILD_NUM = GDParamTool.getInt(paramSheet, 10050, 5);
        basic.FAKE_GUILD_NUM_RANDOM = GDParamTool.getInt(paramSheet, 10051, 5);
        basic.FAKE_GUILD_PRESIDENT_LEVEL = GDParamTool.getInt(paramSheet, 10052, 30);
        recruit.RECRUIT_INTERVAL_SECEND_MIN = GDParamTool.getLong(paramSheet, 10023, 3600);
        recruit.DAILY_RECRUIT_NUM_MAX = GDParamTool.getInt(paramSheet, 10020, 5);
        recruit.DAILY_FREE_RECRUIT_TIME = GDParamTool.getInt(paramSheet, 10021, 1);
        recruit.RECRUIT_COST = GDParamTool.getString(paramSheet, 10022, "");
        member.EXPIRED_DAY = GDParamTool.getInt(paramSheet, 10024, 3);
        member.LOG_NUM_MAX = GDParamTool.getInt(paramSheet, 10046, 100);
        build.BUILD_DISBAND_UNFIX_DAY = GDParamTool.getInt(paramSheet, 10025, 3);
        donate.DONATE_TIMES_LIMIT = GDParamTool.getInt(paramSheet, 10047, 5);
        donate.DONATE_FREE_TIMES = GDParamTool.getInt(paramSheet, 10048, 1);
        redEnvelope.RED_ENVELOPE_KEEP_HOUR = GDParamTool.getLong(paramSheet, 10027, 24);
        redEnvelope.DISPERSION_COEFFICIENT = GDParamTool.getDouble(paramSheet, 10028, 1.0);
        redEnvelope.GUARANTEE_COEFFICIENT = GDParamTool.getDouble(paramSheet, 10029, 0.5);
        redEnvelope.MAX_DRAW_TIME = GDParamTool.getInt(paramSheet, 10030, 10);
        boss.BUFF_NUM_MAX = GDParamTool.getInt(paramSheet, 10040, 5);
        boss.BUFF_COST = GDParamTool.getString(paramSheet, 10041, "");
//        @NoteField(value = "每层BUFF增加攻击力万分比")
//        public static final long BUFF_ADD_Fight = 200;							10042
        boss.BUFF_ADD_Fight = GDParamTool.getLong(paramSheet, 10042, 200);
        boss.HORN_INTERVAL = GDParamTool.getInt(paramSheet, 10043, 3600000);
        boss.HORN_MSG_CONTENT = GDParamTool.getString(paramSheet, 10044, "我吹响了集结号角，召唤挑战协会副本，挑战可获得丰厚奖励！<link17 2403 【我要挑战】>");
        boss.RANK_REWARD_1 = GDParamTool.getDouble(paramSheet, 10031, 4.4);
        boss.RANK_REWARD_2 = GDParamTool.getDouble(paramSheet, 10032, 4.1);
        boss.RANK_REWARD_3 = GDParamTool.getDouble(paramSheet, 10033, 3.7);
        boss.RANK_REWARD_4_10 = GDParamTool.getDouble(paramSheet, 10034, 3);
        boss.RANK_REWARD_11_20 = GDParamTool.getDouble(paramSheet, 10035, 2.2);
        boss.RANK_REWARD_21_50 = GDParamTool.getDouble(paramSheet, 10036, 1.5);
        task.REFRESH_TIME = GDParamTool.getString(paramSheet, 10049, "2:1:5");
        PER_MEMBER_GUILD_EXP = GDParamTool.getInt(paramSheet, 10053, 915);
        Skill.PVP_OPEN_NORMAL_LEVEL = GDParamTool.getInt(paramSheet, 10054, 40);
        Skill.FIRST_COST_FOR_NORMAL_SKILL_BACK = GDParamTool.getString(paramSheet, 10055, "");
        Skill.FIRST_COST_FOR_PVP_SKILL_BACK = GDParamTool.getString(paramSheet, 10056, "");
        Skill.COST_FOR_NORMAL_SKILL_BACK = GDParamTool.getString(paramSheet, 10068, "0:2:100");
        Skill.COST_FOR_PVP_SKILL_BACK = GDParamTool.getString(paramSheet, 10069, "0:2:300");
        TreasureHouse.TREASURE_HOUSE_PUT_IN_TIMES_DAY = GDParamTool.getInt(paramSheet, 10057, 20);
        TreasureHouse.JOIN_DAY_LIMIT = GDParamTool.getInt(paramSheet, 10070, TreasureHouse.JOIN_DAY_LIMIT);

        Fairyland.KILL_MAIL_ID = GDParamTool.getInt(paramSheet, 10059, 0);
        Fairyland.RANK_MAIL_ID = GDParamTool.getInt(paramSheet, 10060, 0);
        Fairyland.NEW_MEMBER_COLD = GDParamTool.getInt(paramSheet, 10061, 24) * TimeTool.TimeCons.HOUR;
        Fairyland.CHALLENGE_TIME = GDParamTool.getInt(paramSheet, 10062, 24) * TimeTool.TimeCons.HOUR;
        Fairyland.COLD_TIME = GDParamTool.getInt(paramSheet, 10063, 48) * TimeTool.TimeCons.HOUR;
        if (Fairyland.COLD_TIME < Fairyland.CHALLENGE_TIME) {
            Fairyland.COLD_TIME = Fairyland.CHALLENGE_TIME;
        }

        activeTask.LIGHT_GUILD_SKILL = GDParamTool.getInt(paramSheet, 10064, activeTask.LIGHT_GUILD_SKILL);
        activeTask.DONATE_COMMON = GDParamTool.getInt(paramSheet, 10065, activeTask.DONATE_COMMON);
        activeTask.FIGHT_BOSS = GDParamTool.getInt(paramSheet, 10066, activeTask.FIGHT_BOSS);
        activeTask.ADD_GUILD_BUFF = GDParamTool.getInt(paramSheet, 10067, activeTask.ADD_GUILD_BUFF);
    }
}
